package cn.dgut.training.entity.activity;

import cn.dgut.training.entity.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;

@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value="GroupBuyingRules对象", description="团购规则表")
public class GroupBuyingRules extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "商品编号")
    private Long goodsId;

    @ApiModelProperty(value = "商品id")
    private String goodsName;

    @ApiModelProperty(value = "商品图片或者商品货品图片")
    private String picUrl;

    @ApiModelProperty(value = "优惠金额")
    private BigDecimal discount;

    @ApiModelProperty(value = "达到优惠条件的人数")
    private Integer discountMember;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "团购过期时间")
    private Date expireTime;

    @ApiModelProperty(value = "团购规则状态，正常上线则0，到期自动下线则1，管理手动下线则2")
    private Integer status;

    @ApiModelProperty(value = "货品id")
    private long productId;

    @ApiModelProperty(value = "商品规格值列表，采用JSON数组格式")
    private String specifications;

    @ApiModelProperty(value = "商品货品数量")
    private Integer productNumber;
}
